
<!doctype html>
<head>
<meta charset="utf-8" />
<title>Canvas Test</title>
</head>
<body>

<canvas id="canvas1" width="400" height="300"></canvas>
<script type="text/javascript" src="test.js"></script>
<script>

var img = new Image();
img.src = 'p1.jpg';
img.onload = init();
</script>

</body>
</html>